<?php

class Application_Form_Login extends Zend_Form
{

    public function init()
    {
		$this->addDecorator('FormElements')        	
			->addDecorator('Form')
			->setAttrib('class','jmenu');
			
		$checkBoxCookie = new Zend_Form_Element_Checkbox('ck');
		$checkBoxCookie
			->setDecorators(array('ViewHelper'))
			
			->addDecorator('Label',array('placement'=>'append'))
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'note small alignright'))
			->addDecorator('Description',array('escape'=>false,'tag'=>'header','class'=>'head','openOnly'=>true,'placement'=>'prepend'))
			->setDescription('<h1>Ingreso</h1>')
			->setLabel('Recordar mis datos');
						
		$textName = new Zend_Form_Element_Text('name');
		$textName
			->setDecorators(array('ViewHelper'))
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field fullwidth'))
			->addDecorator('Description',array('escape'=>false,'tag'=>'div','placement'=>'prepend'))
			->setAttribs(array('data-icon'=>'user'))
			->setAttribs(array('placeholder'=>'Usuario'))
			->setDescription('<span class="divider"></span></div>
								</header>
							  <div class="alert grey air">
                              	<p><strong>&iexcl;Bienvenido nuevamente!</strong> Por favor ingresa tus datos de acceso.</p>
                                <a class="close" href="#">cerrar</a>
                              </div>
							  <div>')
            ->setRequired(true)
            ->addValidator('EmailAddress');
			
		$inputPassword = new Zend_Form_Element_Password('password');
		$inputPassword
			->setDecorators(array('ViewHelper'))
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field fullwidth'))
			->setAttribs(array('data-icon'=>'closed-lock'))
			->setAttribs(array('placeholder'=>'Password'))
            ->setRequired(true);;
			
		$this->addElements( array (
			$checkBoxCookie,
			$textName,
			$inputPassword			
		));		
		
        $submitLogin = new Zend_Form_Element_Submit('login');
		$submitLogin
			->setDecorators(array('ViewHelper'))
			->addDecorator('Description',array('escape'=>false,'tag'=>'span','class'=>'divider','placement'=>'prepend'))
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field fullwidth last'))
			->setAttribs(array('class'=>'bt blue large'))
			->setDescription('&nbsp;')				
			->setLabel('Entrar');
		
		$this->addElements( array (
			$submitLogin
		));
		
    }

}